
#include "gtest/gtest.h"

#include "Stack.h"

TEST( StackTest, Simple )
{
    int x;
    Stack<int> S(3);

    EXPECT_THROW( S.Add( 1 ).Add( 2 ).Add( 3 ).Add( 4 ), class NoMem );
    EXPECT_EQ( 3, S.Top() );

    S.Delete( x );
    EXPECT_EQ( 3, x );
    S.Delete( x );
    EXPECT_EQ( 2, x );
    S.Delete( x );
    EXPECT_EQ( 1, x );
    EXPECT_THROW( S.Delete( x ), class OutOfBounds );
}

#include "main_stub.h"

